package com.wwc.myrule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author WWC
 * 自定义负载均衡算法配置类
 */
@Configuration
public class MySelfRule{

    @Bean
    public IRule myRule() {
        /**
         * 定义负载均衡算法为随机
         */
        return new RandomRule();
    }
}

